home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
005
/
stocks_1.arc
/
MAKSTKFL.DOC
< prev
next >
Wrap
Text File
|
1983-01-04
|
16KB
|
345 lines
DOCUMENTATION FOR MAKSTKFL.BAS
Copyright 1983 BY Michael Csontos
3228 Livonia Center Road
Lima, New York 14485
January 4, 1983
INTRODUCTION
This program assists in the generation of data files for securities price
and volume data. It is intended for use with other programs that will analyze
and/or plot the data. The program is designed to use the Wall Street Journal or
other newspaper financial statistics pages for manual entry of the data into
ASCII sequential files accessable to BASIC, EDLIN and other languages under
PC-DOS.
It includes a simple plotting routine, but the program PLTSTKFL.BAS by me
is intended for serious plotting of the data files on an EPSON printer.
I have written another companion program named DAYLOG.BAS which will
generate forms on the printer for use in recording securities (or other)
statistics. These three programs allow you to gather data from a library or a
stack of newspapers that would be awkward to handle at the computer (DAYLOG),
create data files (MAKSTKFL), and plot the data (PLTSTKFL).
I have provided no means of editing or correcting the files after they
are created. While the DOS utility EDLIN is quite limited, it is adaquate for
the purpose. Also I have purposely avoided the use of the CLS (clear screen)
command. While it may look more professional to start each segment with a blank
sereen, and it is unfortunate that scrolling is not smooth on a computer
screen, I like the ability to review for a few seconds what I have done before
it vanishes completely.
All data entry is in decimal. I found it confusing to remember a format
for entering fractions with the numeric keypad, and easy to remember the
decimal equivalents of eighths. A small calculator might be useful if you trade
in securities traded in 32nds or 16ths.
There is no automatic transfer from the end of one function to a menu
(except for the documentation read function). With the PC's <F2> key programed
for RUN and the keyboard buffer available I felt that it was not necessary. If
you finish one stock file and know which one you want next, you can key in
something like <F2><2><3><C><O><M><S><H><A><R><E>, and probably the first data
entry, about as fast as the disk drive takes to reach that part of the program.
This is as easy as using another menu to get you there from the end of the
program.
This program makes reference to or creates several other files listed
below and explained later.
MAKSTKFL.DOC which you are reading
UPDSTKFL.ALL a list of all securities files
UPDSTKFL.DAT a list of active securities files
TRANSFER.BAT a batch file used to backup data files
????????.DJA data file created by MAKSTKFL
????????.NYS " " " " "
????????.OTC " " " " "
????????.OPT " " " " "
????????.MUT " " " " "
PROGRAM OPERATION
When the program is run it immediately checks for the presence of the
files MAKSTKFL.DOC and UPDSTKFL.DAT. If they are present you are presented with
a menu with eight selections. If these files are not on the active disk the
selections that would use them are omitted.
There are two menus presented. The first selects the function to be
performed. The second selects the type of security file to be used. The second
menu is skipped when it is not needed.
A description of the menu selections follows.
FIRST MENU - FUNCTION
(1): INSERT DATA
If a securities data file (specified by the second menu) exists on the
active disk the program finds its starting date, renames it to ????????.OLD,
opens a new file with securities file name, allows you to enter data from a
date you specify till the old file's starting date, then transfers the old data
onto the end of the new file. This allows you to extend your database backward
in time.
(2): ADD DATA
Using an existing data file, the program finds the last entry date, then
appends data you enter until you tell it to stop by entering a code number
(9999).
(3): NEW DATA
The program will open a new file with a filename you specify and an
extension for the security type selected in the second menu. You specify the
starting date and enter data until you enter the stop code 9999.
(4): DATE RANGE
The first and last dates in the specified security file are displayed on
the screen.
(5): REPORT
All data for the specified security is printed on the printer. This is
useful if you have been entering data directly from a newspaper or data service
and have no written record. The format is easier to read than an EDLIN listing
or a dump using the DOS TYPE command.
(6): SCREEN GRAPH
This is an abbreviated version of PLTSTKFL directed to the screen for use
as a quick check of recently entered data. While the data entry routines trap
many typographical errors, others don't show up until an attempt is made to
plot the data.
(7): UPDATE
In order to use this function you must have a file called UPDSTKFL.DAT on
the active disk. You create this file in DOS with EDLIN UPDSTKFL.DAT or COPY
CON: UPDSTKFL.DAT. It is simply a list of the files you want to update on a
daily basis. An example of an EDLIN listing is:
1:*TRANS.DJA
2: DELTAA.NYS
3: UNPAC,NYS
4: DOW8_508.NYS
5: BIOTECH.OTC
The program will read this file line by line, retrieve the file listed,
find the last date, allow you to enter the next day's data, then go to the next
file in the UPDSTKFL list. The program selects the proper data format from the
extension of the filespec on the list.
While the program will not permit more than one day's data to be enered
at a time in this mode, if the skip code (8888) is entered the next date will
be used, to allow for the skipping of holidays.
It may be convenient to have a file UPDSTKFL.ALL on the disk listing all
stock files you have created. It is considerably easier to delete lines from
files with EDLIN than to type in filespecs without errors each time you want to
change your updating cycle. Just copy UPDSTKFL.ALL to UPDATKFL.DAT and edit the
DAT file.
(8): DOCUMENTATION
If the file MAKSTKFL.DOC is present on the active disk, this mode will
allow you to read it without leaving BASIC or reloading the program.
SECOND MENU - SECURITY TYPE
Selection of the type of security is necessary for the convience of data
entry, since the published tables present different types of information and in
different order for various markets. All of the formats are based on listings
in The Wall Street Journal.
(1): Dow Jones Averages
This is for the entries from the tables of 30 INDUSTRIALS, 20
TRANSPORTATION, 15 UTILITIES and 65 STOCKS COMPOSITE AVERAGE data. The data
file format is actually the same as for selection (2) but this allows for entry
in the same order as in the paper. The entry order is CLOSE, HIGH, LOW,
VOLUME.
The data file is "date",volume,high,low,close.
(2): New York Stock Exchange
Covers the data for the NYSE-Composite Transactions as well as New York
Exchange Bonds and Amex-Composite Tranactions. The order of entry is VOLUME,
HIGH, LOW, CLOSE.
The data file is "data",volume,high,low,close.
(3): Over the Counter Markets
Data entry in the order VOLUME, BID, ASKED for NASDAQ quotes of the
Over-the-Counter Markets.
The data file is "date",volume,bid,asked,0.
(4): Options
Listed Options Quotations data in the order NY CLOSE, CALLS, PUTS.
It is important for options files that the last two characters of the
filename be the strike price of the option if this data is to be used by the
program PLTSTKFL. An example is BETHJA35 where the filespec will be
BETHJA35.OPT. In plotting options data, PLTSTKFL extracts the last two
characters in the filename for use as a baseline in the plot.
The data file is "date",0,call,put,close.
(5): Mutual Funds
NET ASSET VALUE and OFFER PRICE data entry for Mutual Fund data.
The data file is "date",0,nav,offer,0
The data file formats above are what you will see if you list the files
with DOS [type] or EDLIN. The null (0) entries are used to allow common
subroutines to be used for search or conversion of all of the data types.
FILE SELECTION
After you have specified a securities type, you will be presented with a
list of the files of that type that are on the active disk. You must then enter
the filename of the one you want. The filename may be any that is acceptable to
DOS except in the case of options, where the last two characters are used to
record the strike price.
{NOTE: The filespec consists of [filename].[extension]. You are to enter
the eight (or less) character [filename]. The three character [extension] is
supplied by the program.}
If you enter a filename that is on the disk but not on the list
displayed, you may add data to that file in the wrong format, causing confusion
later. Therefore check the filespec displayed in line 25 of the display before
proceeding to enter data.
.
DATA ENTRY
Once the program is in a mode for data entry it will list the security
dile open on line 25, the date for the data to be entered and the type of data
in the active screen area. The program uses BASIC INPUT statements so it will
reject some data entries such as characters and extra punctuation marks. The
program will trap some errors such as decimal points in volume entries and
inappropriate values for HIGH, LOW, and CLOSE relative to data already entered
for that date.
The program will prompt for reentry of the data just entered. If the
problem is with data entered earlier, enter the number 7777 and the program
will restart the data entry cycle with the same date. The program does not
expect securities prices to change by more than 25% in one day. If this data is
entered, it askes for a second <enter> to confirm it.
Once the last data for a day is entered the program prompts for the next
day's data and there is no way to retreive the previous data (see ERROR
CORRECTION). The number 7777 may be entered for any field to restart the data
cycle at the same date to correct errors that are caught before the last entry.
If the number 8888 is entered the program will skip to the next date and there
will be no item in the data file for the date so skipped. When the number 9999
is entered the program ends the data entry mode. No data entry is made for that
last date.
ERROR CORRECTION
The data files created with this program use the following format:
"date",data AA,data BB,data CC,data DD
A typical EDLIN listing would look like:
1:*"12-10-82",1234,22.375,21,22.125
2: "12-13-82",1324,22.875,21.5,22
3: "12-14-82",4231,20,19.125,21.25
This is not intended to be a tutorial on how to use EDLIN, but the
procedure for correcting a file is to exit BASIC (enter <SYSTEM>), start EDLIN
(enter <A:EDLIN filespec> if your DOS disk is in drive A and your data is in
active drive B) and enter <L>. A listing similar to the above will appear. Find
the date where the error occors. Enter the line number and the line will appear
with the prompt below it. Use the DOS editing keys to correct the error, then
exit EDLIN.
With the error trapping routines of MAKSTKFL this procedure should seldom
be necessary.
DATA BACKUP
This program opens all files for output in the APPEND mode so it is
difficult to loose data. Nevertheless it is advisable to regularly backup your
data. The file TRANSFER.BAT is provided to simplify this procedure. It depends
on having a two disk system with the MAKSTKFL program, its associated data
files, and TRANSFER.BAT all in drive B and the backup disk in drive A.
If you are using PLTSTKFL or other analysis program it is a good idea to
use the disk containing it as the backup disk for the following reason. When
run, TRANSFER will first erase all stock data files in drive A. This is useful
because if the files are updated on a daily basis they will become very
fragmented by the DOS disk routines. Since the copy command uses existing
directory entries on the destination disk if they exist, they must be erased in
order to get good disk utilization on the backup disk. Using the backup files
with analysis programs should decrease disk drive activity.
If the disks are in the proper drives, TRANSFER will try to erase itself
in drive A as a precaution, erase securities in drive A, then copy all
securities files in drive B to drive A.
Since it is possible for this routine to distroy itself if misused, it is
listed below. You may recreate the file by editing this file if you are clever
at that sort of thing.
rem WARNING!!!
REM This routine will erase all stock data files in drive A:.
rem Be sure that this disk is in drive B:.
rem The transfer is made from drive B: to drive A:.
rem As a precaution this transfer batch file will erase itself if it
is in drive A:.
pause WARNING! Press <Ctrl>+<Break> if you think you are in
trouble.
erase A:transfer.bat
erase a:*.dja
erase a:*.nys
erase a:*.otc
erase a:*.opt
erase a:*.mut
rem All stock data files will be transfered from B: to A:.
rem Be sure that the source disk is in drive B:
pause and that the destination disk is in drive A:
copy *.dja A:
copy *.nys A:
copy *.otc A:
copy *.opt A:
copy *.mut A:
MISCELLANEOUS
At the time of this writing this program has quite a few rough edges
which will have to be worked off by use. The error recovery procedures for disk
and printer faults especially need work. It will be necessary to simulate all
possible faults and trace the behavior of the software. However most of this is
cosmetic, since restarting the program (from <Ctrl>+<Break> if necessary) will
solve most problems. The nature of the data entry and the ease of editing the
files make this program tolerant of errors.
Revisions of this program and companion programs will be made avilable
through the user groups that distribute this program.
---***---
The program MAKSTKPLT.BAS and its associated
files are made freely available non-exclusively
for distribution to the members of the Picture
City Personal Computer Programmers' Club and
through software exchange with other users groups
as long as the author and (PC)^3 are fully
credited.